/* ex: set tabstop=4 shiftwidth=4 expandtab: */
#ifndef _HTTP_H
#define _HTTP_H

typedef enum {
	HTTP_PATH_MESSAGE0,
	HTTP_PATH_MESSAGE1,
	HTTP_PATH_MESSAGE2,
	HTTP_PATH_MESSAGE3,
	HTTP_PATH_CONNECT,
	HTTP_PATH_LFXMSG,
	HTTP_PATH_UNKNOWN = 255
} http_path_t;

typedef enum {
	HTTP_METHOD_GET,
	HTTP_METHOD_POST,
	HTTP_METHOD_UNKNOWN = 255
} http_method_t;

extern int http_parse_request(char *buf, int len, http_method_t *method, http_path_t *path, char **headers);

extern int http_get_header(char *headers, char *name, char *header);

extern int http_get_param(char *header, char *name, char *param);

extern char *http_get_payload(char *request);

extern int http_get_content_length(char *request);

#endif
